package com.wg.dome.repository;


import com.wg.dome.attribute.Attribute;
import com.wg.dome.attribute.AttributeType;
import com.wg.dome.entity.config.ZhuLingClothesEntity;
import com.wg.db.cache.AbstractUniqueCacheRepository;


public class ZhuLingClothesRepository extends AbstractUniqueCacheRepository<ZhuLingClothesEntity> {
    public ZhuLingClothesRepository() {
        super(ZhuLingClothesEntity.class);
    }

    public void getAttribute(int zlLv, Attribute attribute){
        ZhuLingClothesEntity entity = get(zlLv);
        if (entity == null){
            return;
        }

        attribute.set(AttributeType.DEF, entity.getDef());
        attribute.set(AttributeType.EVD, entity.getEvd());
    }

    public int getUseCount(int zlLv){
        ZhuLingClothesEntity entity = get(zlLv);
        return entity.getUseItemCount();
    }
}
